<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>详细信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
</head>
<body>
    <div class="layui-container">
        <div class="layui-row">
            <div class="layui-col-lg-offset3" layui-col-lg6>
                <div class="layui-form layuimini-form">
                    <form class="layui-form" action="" lay-filter="userForm">
                        <input type="hidden" id= "id3" name="id"  value=""  >
                        <div class="layui-form-item">
                            <label class="layui-form-label required">名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="name" readonly="true"value=""
                                    class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label required">编号</label></label>
                            <div class="layui-input-block">
                                <input type="number" readonly="true"name="number"value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">功效</label>
                            <div class="layui-input-block">
                                <input type="text" readonly="true"name="efficacy" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">库存</label></label></label>
                            <div class="layui-input-block">
                                <input type="number" readonly="true"name="inventory" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">批发价</label></label></label>
                            <div class="layui-input-block">
                                <input readonly="true"type="number" name="wholesalePrice"  value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">售价</label></label></label>
                            <div class="layui-input-block">
                                <input readonly="true" type="number" name="price"   value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">生产厂家</label>
                            <div class="layui-input-block">
                                <input type="text" readonly="true"name="manufacturer" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">生产日期：</label>
                            <div class="layui-input-block">
                                <input type="text" readonly="true"name="productionDate" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">保质期</label>
                            <div class="layui-input-block">
                                <input type="text"readonly="true" name="qualityDate" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label required">照片：</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list">
                                        <img style="width: 100px;" class="layui-upload-img" id="demo1">
                                    </div>
                                </div>
                            </div>
                        </div>
                  
                    </form>
                </div>

            </div>
        </div>
    </div>
    <script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script>
        //Demo
        layui.use(['upload', 'element', 'form'], function () {
            var form = layui.form
                , $ = layui.jquery
                , upload = layui.upload
                , element = layui.element
                , laydate = layui.laydate;

            //日期
            laydate.render({
                elem: '#date'
            });


            var data = JSON.parse(localStorage.getItem("user"));    
            //给表单数据赋值
            form.val("userForm",{
                "id": data.id,
                "name":data.name,
                "number":data.number,
                "efficacy":data.efficacy,
                "inventory":data.inventory,
                "wholesalePrice":data.wholesalePrice,
                "price":data.price,
                "manufacturer":data.manufacturer,
                "productionDate":data.productionDate,
                "qualityDate":data.qualityDate,
            });    
            $('#demo1').attr('src', data.picture);
           
        });
    </script>
</body>
</html>